package org.easyx.ser.sys.serivce.impl;

import org.easyx.core.utils.ObjKit;
import org.easyx.ser.sys.entity.Organization;
import org.easyx.ser.sys.mapper.OrganizationMapper;
import org.easyx.ser.sys.serivce.OrganizationService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

/**
 * <p>
 * 组织机构 服务实现类
 * </p>
 *
 * @author xiaojl
 * @since 2017-09-19
 */
@Service
public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Organization> implements OrganizationService {

	@Override
	public void deleteWithCascade(Organization entity) {
		if(ObjKit.isNotEmpty(entity)){
			this.delete(new EntityWrapper<Organization>().eq("pid",entity.getId()));
			this.deleteById(entity.getId());
		}
	}
	
}
